<?php
/*
   +----------------------------------------------------------------------
   | 倒霉狐狸的便携式文档生成器
   +----------------------------------------------------------------------
   | Copyright (c) 2014 http://www.evildao.com All rights reserved.
   +----------------------------------------------------------------------
   | Author: 小子(LT) <mail@xiaoliu.org>
   +----------------------------------------------------------------------
   | Date:2017-8-28 13:38:35
   +----------------------------------------------------------------------
*/
class wiki {
    private $config = [
        'NOP' => ['.', '..', '.git'],
        'MAP_STR' => '',
        'ROOT_PATH' => '',
    ];
    function __construct() {
        $this->config['ROOT_PATH'] = __DIR__. "/";
        $this->buildMap();
        $_SESSION['nav'] = $this->config['MAP_STR'];
    }

    private function buildMap($path = '', $space = '') {
        foreach ($this->ls($this->config['ROOT_PATH']. $path) as $v) {
            if(is_dir($this->config['ROOT_PATH']. $path. $v)) {
                $this->config['MAP_STR'] .= $space. "* ". @iconv('gbk', 'utf-8', $v). " \n";
                $this->buildMap($path. $v.'/', $space. "\t");
            } else {
                $_tt = explode('.', $v);
                if(end($_tt) == 'md') {
                    $file = file($path. $v);
                    if(isset($file[0])) {
                        $file = explode('#', $file[0]);
                        $file = is_array($file) ? ' - '. trim(end($file)) : '';
                    } else {
                        $file = '';
                    }
                    array_pop($_tt);
                    $_tt = implode('.', $_tt);
                    $_tt = @iconv('gbk', 'utf-8', $_tt);
                    $this->config['MAP_STR'] .= $space. "* [". $_tt. $file. "](?page=". urlencode(@iconv('gbk', 'utf-8', $path). $_tt). ".md) \n";
                }
            }
        }
    }

    //目录文件名获取函数
    private function ls($dir) {
        $handle = @opendir($dir);
        $list = array();
        while(true == ($file = readdir($handle))) {
            if (!in_array($file, $this->config['NOP'])) {
                $list[]=$file;
            }
        }
        closedir($handle); 
        return $list;
    }
}
@session_id('ufoxnav');
@session_start();
isset($_GET['key']) || $_GET['key'] = 'index';
if($_GET['key'] == 'flush' && isset($_SESSION['nav'])) {
    unset($_SESSION['nav']);
    @session_destroy();
} elseif($_GET['key'] == 'nav') {
    if(!isset($_SESSION['nav'])) {
        new wiki;
    }
    echo $_SESSION['nav'];
} elseif($_GET['key'] == 'index') {
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>倒霉狐狸的便携式文档生成器</title>
    <link rel="stylesheet" href="?key=css">
</head>
<body>
    <nav class="nav" id="markdown-nav"> </nav>
    <div id="move_ctrl"></div>
    <article class="markdown-body" id="markdown-body"></article>
    <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
    <script src="?key=mdjs"></script>
    <script>
        var url = location.search; //获取url中"?"符后的字串 
        var theRequest = new Object(); 
        if (url.indexOf("?") != -1) { 
            var str = url.substr(1); 
            strs = str.split("&"); 
            for(var i = 0; i < strs.length; i++) { 
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]); 
            } 
        }
        if(!theRequest.page) {
            theRequest.page = 'index.md';
        }
        $("title").html(decodeURIComponent(theRequest.page));
        $.get('?key=nav', function(data){
            $('#markdown-nav').html(Mdjs.md2html(data));
            $('#markdown-nav ul ul').hide();
            $('#markdown-nav ul [href="?page='+escape(theRequest.page)+'"]').css({'text-decoration': 'underline','color':'#008cff'});
            $('#markdown-nav ul [href="?page='+escape(theRequest.page)+'"]').parents().show();
            $('#markdown-nav ul li').click(function(){
              $(this).next('ul').toggle();
            });
        });
        var doc = $(document), dl = $("#move_ctrl"), dc = $("article");
        $("#move_ctrl").mousedown (function (e) {
            var deltaX = e.clientX,
                ctrl = {
                    'nav':parseFloat($("nav").css('width')),
                    'ctrl':parseFloat($("#move_ctrl").css('left')),
                    'body':parseFloat($(".markdown-body").css('margin-left'))
                };
            doc.mousemove(function (e){
                var lt = e.clientX - deltaX;
                $("#move_ctrl").css('left',  ctrl.ctrl + lt + 'px');
                $("nav").css('width',  ctrl.nav + lt + 'px');
                $(".markdown-body").css('margin-left',  ctrl.body + lt + 'px');
            });
        });
        doc.mouseup (function(){
            doc.unbind("mousemove");
        });
        $.get(theRequest.page, function(data){
            var html = Mdjs.md2html(data);
            $('#markdown-body').html(html);
        });
    </script>
</body>
</html>
<?php } elseif ($_GET['key'] == 'css') { header("content-type:text/css");?>
/*
   +----------------------------------------------------------------------
   | markdown 渲染CSS - Book版
   +----------------------------------------------------------------------
   | Copyright (c) 2014 http://www.evildao.com All rights reserved.
   +----------------------------------------------------------------------
   | Author: 小子(LT) <mail@xiaoliu.org>
   +----------------------------------------------------------------------
   | Date:2016-11-12 14:46:50
   +----------------------------------------------------------------------
*/
body{padding: 0px;margin: 0px;position:relative;}
nav{font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;position: fixed;top: 0;left: 0px;bottom: 0;z-index: 1;overflow-y: auto;width: 300px;color: #364149;background: #fafafa;border-right: 1px solid rgba(0,0,0,.07);transition: left 250ms ease;}
nav ul{list-style: none;margin: 15px;padding: 0px;transition: top .5s ease;}
nav li{margin: 12px;/*border:0.1px dashed  #008cff;*/}
nav ul li:hover{color: #0E0A0F;text-decoration: underline;cursor: pointer;}
nav ul li ul{padding-left: 20px;}
nav a{/*line-height: 2em;*/color: #364149;text-decoration: none;}
#move_ctrl{cursor: ew-resize;position: fixed;width: 5px;top: 0;left: 300px;bottom: 0;z-index: 1;overflow-y: auto;}
.markdown-body{margin-left:342px;padding: 20px;position: relative;}
@font-face {font-family: fontawesome-mini;src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAzUABAAAAAAFNgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABwAAAAcZMzaOEdERUYAAAGIAAAAHQAAACAAOQAET1MvMgAAAagAAAA+AAAAYHqhde9jbWFwAAAB6AAAAFIAAAFa4azkLWN2dCAAAAI8AAAAKAAAACgFgwioZnBnbQAAAmQAAAGxAAACZVO0L6dnYXNwAAAEGAAAAAgAAAAIAAAAEGdseWYAAAQgAAAFDgAACMz7eroHaGVhZAAACTAAAAAwAAAANgWEOEloaGVhAAAJYAAAAB0AAAAkDGEGa2htdHgAAAmAAAAAEwAAADBEgAAQbG9jYQAACZQAAAAaAAAAGgsICJBtYXh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El8gJWa58iL+JO7UfkOh4l9yMv4UnyEtvQGGECgwF66MNBooF1bGCL1ELB/TYU+ZBRlvsKQ44Se6jQ4a7hef+fh72Crv25kp+8lNWGmeKoOI5jJLb1aGIGvb6TjfWNLdkqdFvJw4l1amjlXtXRZqRN7lSRylZZyhBqpVFWmTEXgWfUrpi/hZOQXdOd4rKuXOtEWT3k5IArPRzTUU5tHKjecZkTpnVbNOnt6jzN8240GD4xtikvZW56043rPMg/dS+dlOceXoR+WPbJ55Dsekq1lJpnypsMUsYOdCW30o103Ytu/lvh+5RWFLfBjm9/N8hJntPhvx92rnoE/kyHdGasGy754kw36vsVf/lFeBi+0COu+cfgQr42G3CRpeLoZ53gmfe3X6rcKt5oVxnptHR9JS8ehVUd5wvvahN2uqxOOpMXapibI5k7Zwbt4xBSaTfoKBufhAnO/uqNcfK8OTs0OQ6l7JIqFjDhYj5WcjevCnI/1DDiI8j4ndWb/5YzDZWh79yomWXeXj7Nnw70/2TIeFPTrlSh89k1ObOSRVZWZfgF0r/zJQB4nG2JUQuCQBCEd07TTg36fb2IyBaLd3vWaUh/vmSJnvpgmG8YcmS8X3Shf3R7QA4OBUocUKHGER5NNbOOEvwc1txnuWkTRb/aPjimJ5vXabI+3VfOiyS15UWvyezM2xiGOPyuMohOH8O8JiO4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAA=) format('woff');}
@font-face {font-family: octicons-anchor;src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAAC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FmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');}
.markdown-body {font-family: sans-serif;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;color: #333333;overflow: hidden;font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;font-size: 16px;line-height: 1.6;word-wrap: break-word;}
.markdown-body a {background: transparent;}
.markdown-body a:active, .markdown-body a:hover {outline: 0;}
.markdown-body b, .markdown-body strong {font-weight: bold;}
.markdown-body mark {background: #ff0;color: #000;font-style: italic;font-weight: bold;}
.markdown-body sub, .markdown-body sup {font-size: 75%;line-height: 0;position: relative;vertical-align: baseline;}
.markdown-body sup {top: -0.5em;}
.markdown-body sub {bottom: -0.25em;}
.markdown-body h1 {font-size: 2em;margin: 0.67em 0;}
.markdown-body img {border: 0;}
.markdown-body hr {-moz-box-sizing: content-box;box-sizing: content-box;height: 0;}
.markdown-body pre {overflow: auto;}
.markdown-body code, .markdown-body kbd, .markdown-body pre, .markdown-body samp {font-family: monospace, monospace;font-size: 1em;}
.markdown-body input {color: inherit;font: inherit;margin: 0;}
.markdown-body html input[disabled] {cursor: default;}
.markdown-body input {line-height: normal;}
.markdown-body input[type="checkbox"] {box-sizing: border-box;padding: 0;}
.markdown-body table {border-collapse: collapse;border-spacing: 0;}
.markdown-body td, .markdown-body th {padding: 0;}
.markdown-body .codehilitetable {border: 0;border-spacing: 0;}
.markdown-body .codehilitetable tr {border: 0;}
.markdown-body .codehilitetable pre, .markdown-body .codehilitetable div.codehilite {margin: 0;}
.markdown-body .linenos, .markdown-body .code, .markdown-body .codehilitetable td {border: 0;padding: 0;}
.markdown-body td:not(.linenos) .linenodiv {padding: 0 !important;}
.markdown-body .code {width: 100%;}
.markdown-body .linenos div pre, .markdown-body .linenodiv pre, .markdown-body .linenodiv {border: 0;-webkit-border-radius: 0;-moz-border-radius: 0;border-radius: 0;-webkit-border-top-left-radius: 3px;-webkit-border-bottom-left-radius: 3px;-moz-border-radius-topleft: 3px;-moz-border-radius-bottomleft: 3px;border-top-left-radius: 3px;border-bottom-left-radius: 3px;}
.markdown-body .code div pre, .markdown-body .code div {border: 0;-webkit-border-radius: 0;-moz-border-radius: 0;border-radius: 0;-webkit-border-top-right-radius: 3px;-webkit-border-bottom-right-radius: 3px;-moz-border-radius-topright: 3px;-moz-border-radius-bottomright: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;}
.markdown-body * {-moz-box-sizing: border-box;box-sizing: border-box;}
.markdown-body input {font: 13px Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";line-height: 1.4;}
.markdown-body a {color: #4183c4;text-decoration: none;}
.markdown-body a:hover, .markdown-body a:focus, .markdown-body a:active {text-decoration: underline;}
.markdown-body hr {height: 0;margin: 15px 0;overflow: hidden;background: transparent;border: 0;border-bottom: 1px solid #ddd;}
.markdown-body hr:before, .markdown-body hr:after {display: table;content: " ";}
.markdown-body hr:after {clear: both;}
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {margin-top: 15px;margin-bottom: 15px;line-height: 1.1;}
.markdown-body h1 {font-size: 30px;}
.markdown-body h2 {font-size: 21px;}
.markdown-body h3 {font-size: 16px;}
.markdown-body h4 {font-size: 14px;}
.markdown-body h5 {font-size: 12px;}
.markdown-body h6 {font-size: 11px;}
.markdown-body blockquote {margin: 0;}
.markdown-body ul, .markdown-body ol {padding: 0;margin-top: 0;margin-bottom: 0;}
.markdown-body ol ol, .markdown-body ul ol {list-style-type: lower-roman;}
.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol {list-style-type: lower-alpha;}
.markdown-body dd {margin-left: 0;}
.markdown-body code, .markdown-body pre,.markdown-body samp {font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px;}
.markdown-body pre {margin-top: 0; margin-bottom: 0;}
.markdown-body kbd {background-color: #e7e7e7; background-image: -moz-linear-gradient(#fefefe, #e7e7e7); background-image: -webkit-linear-gradient(#fefefe, #e7e7e7); background-image: linear-gradient(#fefefe, #e7e7e7); background-repeat: repeat-x; border-radius: 2px; border: 1px solid #cfcfcf; color: #000; padding: 3px 5px; line-height: 10px; font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace; display: inline-block;}
.markdown-body>*:first-child {margin-top: 0 !important;}
.markdown-body>*:last-child {margin-bottom: 0 !important;}
.markdown-body .headeranchor-link {position: absolute; top: 0; bottom: 0; left: 0; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px;}
.markdown-body .headeranchor-link:focus {outline: none;}
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6 {position: relative; margin-top: 1em; margin-bottom: 16px; font-weight: bold; line-height: 1.4;}
.markdown-body h1 .headeranchor,.markdown-body h2 .headeranchor,.markdown-body h3 .headeranchor,.markdown-body h4 .headeranchor,.markdown-body h5 .headeranchor,.markdown-body h6 .headeranchor {display: none; color: #000; vertical-align: middle;}
.markdown-body h1:hover .headeranchor-link,.markdown-body h2:hover .headeranchor-link,.markdown-body h3:hover .headeranchor-link,.markdown-body h4:hover .headeranchor-link,.markdown-body h5:hover .headeranchor-link,.markdown-body h6:hover .headeranchor-link {height: 1em; padding-left: 8px; margin-left: -30px; line-height: 1; text-decoration: none;}
.markdown-body h1:hover .headeranchor-link .headeranchor,.markdown-body h2:hover .headeranchor-link .headeranchor,.markdown-body h3:hover .headeranchor-link .headeranchor,.markdown-body h4:hover .headeranchor-link .headeranchor,.markdown-body h5:hover .headeranchor-link .headeranchor,.markdown-body h6:hover .headeranchor-link .headeranchor {display: inline-block;}
.markdown-body h1 {padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid #eee;}
.markdown-body h2 {padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid #eee;}
.markdown-body h3 {font-size: 1.5em; line-height: 1.43;}
.markdown-body h4 {font-size: 1.25em;}
.markdown-body h5 {font-size: 1em;}
.markdown-body h6 {font-size: 1em; color: #777;}
.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body .admonition {margin-top: 0; margin-bottom: 16px;}
.markdown-body hr {height: 4px; padding: 0; margin: 16px 0; background-color: #e7e7e7; border: 0 none;}
.markdown-body ul,.markdown-body ol {padding-left: 2em;}
.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul {margin-top: 0; margin-bottom: 0;}
.markdown-body li>p {margin-top: 16px;}
.markdown-body dl {padding: 0;}
.markdown-body dl dt {padding: 0; margin-top: 16px; font-size: 1em; font-style: italic; font-weight: bold;}
.markdown-body dl dd {padding: 0 16px; margin-bottom: 16px;}
.markdown-body blockquote {padding: 0 15px; color: #777; border-left: 4px solid #ddd;}
.markdown-body blockquote>:first-child {margin-top: 0;}
.markdown-body blockquote>:last-child {margin-bottom: 0;}
.markdown-body table {display: block; width: 100%; overflow: auto; word-break: normal; word-break: keep-all;}
.markdown-body table th {font-weight: bold;}
.markdown-body table th,.markdown-body table td {padding: 6px 13px; border: 1px solid #ddd;}
.markdown-body table tr {background-color: #fff; border-top: 1px solid #ccc;}
.markdown-body table tr:nth-child(2n) {background-color: #f8f8f8;}
.markdown-body img {max-width: 100%; -moz-box-sizing: border-box; box-sizing: border-box;}
.markdown-body code,.markdown-body samp {padding: 0; padding-top: 0.2em; padding-bottom: 0.2em; margin: 0; font-size: 85%; background-color: rgba(0,0,0,0.04); border-radius: 3px;}
.markdown-body code:before,.markdown-body code:after {letter-spacing: -0.2em; content: "\00a0";}
.markdown-body pre>code {padding: 0; margin: 0; font-size: 100%; word-break: normal; white-space: pre; background: transparent; border: 0;}
.markdown-body .codehilite {margin-bottom: 16px;}
.markdown-body .codehilite pre,.markdown-body pre {padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: #f7f7f7; border-radius: 3px;}
.markdown-body .codehilite pre {margin-bottom: 0; word-break: normal;}
.markdown-body pre {word-wrap: normal;}
.markdown-body pre code {display: inline; max-width: initial; padding: 0; margin: 0; overflow: initial; line-height: inherit; word-wrap: normal; background-color: transparent; border: 0;}
.markdown-body pre code:before,.markdown-body pre code:after {content: normal;}
/* Admonition */.markdown-body .admonition {-webkit-border-radius: 3px; -moz-border-radius: 3px; position: relative; border-radius: 3px; border: 1px solid #e0e0e0; border-left: 6px solid #333; padding: 10px 10px 10px 30px;}
.markdown-body .admonition table {color: #333;}
.markdown-body .admonition p {padding: 0;}
.markdown-body .admonition-title {font-weight: bold; margin: 0;}
.markdown-body .admonition>.admonition-title {color: #333;}
.markdown-body .attention>.admonition-title {color: #a6d796;}
.markdown-body .caution>.admonition-title {color: #d7a796;}
.markdown-body .hint>.admonition-title {color: #96c6d7;}
.markdown-body .danger>.admonition-title {color: #c25f77;}
.markdown-body .question>.admonition-title {color: #96a6d7;}
.markdown-body .note>.admonition-title {color: #d7c896;}
.markdown-body .admonition:before,.markdown-body .attention:before,.markdown-body .caution:before,.markdown-body .hint:before,.markdown-body .danger:before,.markdown-body .question:before,.markdown-body .note:before {font: normal normal 16px fontawesome-mini; -moz-osx-font-smoothing: grayscale; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; line-height: 1.5; color: #333; position: absolute; left: 0; top: 0; padding-top: 10px; padding-left: 10px;}
.markdown-body .admonition:before {content: "\f056\00a0"; color: 333;}
.markdown-body .attention:before {content: "\f058\00a0"; color: #a6d796;}
.markdown-body .caution:before {content: "\f06a\00a0"; color: #d7a796;}
.markdown-body .hint:before {content: "\f05a\00a0"; color: #96c6d7;}
.markdown-body .danger:before {content: "\f057\00a0"; color: #c25f77;}
.markdown-body .question:before {content: "\f059\00a0"; color: #96a6d7;}
.markdown-body .note:before {content: "\f040\00a0"; color: #d7c896;}
.markdown-body .admonition::after {content: normal;}
.markdown-body .attention {border-left: 6px solid #a6d796;}
.markdown-body .caution {border-left: 6px solid #d7a796;}
.markdown-body .hint {border-left: 6px solid #96c6d7;}
.markdown-body .danger {border-left: 6px solid #c25f77;}
.markdown-body .question {border-left: 6px solid #96a6d7;}
.markdown-body .note {border-left: 6px solid #d7c896;}
.markdown-body .admonition>*:first-child {margin-top: 0 !important;}
.markdown-body .admonition>*:last-child {margin-bottom: 0 !important;}
/* progress bar*/
.markdown-body .progress {display: block; width: 300px; margin: 10px 0; height: 24px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; background-color: #ededed; position: relative; box-shadow: inset -1px 1px 3px rgba(0, 0, 0, .1);}
.markdown-body .progress-label {position: absolute; text-align: center; font-weight: bold; width: 100%; margin: 0; line-height: 24px; color: #333; text-shadow: 1px 1px 0 #fefefe, -1px -1px 0 #fefefe, -1px 1px 0 #fefefe, 1px -1px 0 #fefefe, 0 1px 0 #fefefe, 0 -1px 0 #fefefe, 1px 0 0 #fefefe, -1px 0 0 #efefe, 1px 1px 2px #000; -webkit-font-smoothing: antialiased !important; white-space: nowrap; overflow: hidden;}
.markdown-body .progress-bar {height: 24px; float: left; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; background-color: #96c6d7; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(0, 0, 0, .1); background-size: 30px 30px; background-image: -webkit-linear-gradient(  135deg, rgba(255, 255, 255, .4) 27%,  transparent 27%,  transparent 52%, rgba(255, 255, 255, .4) 52%,  rgba(255, 255, 255, .4) 77%,  transparent 77%, transparent ); background-image: -moz-linear-gradient(  135deg,  rgba(255, 255, 255, .4) 27%, transparent 27%,  transparent 52%, rgba(255, 255, 255, .4) 52%,  rgba(255, 255, 255, .4) 77%, transparent 77%,  transparent ); background-image: -ms-linear-gradient(  135deg,  rgba(255, 255, 255, .4) 27%, transparent 27%,  transparent 52%, rgba(255, 255, 255, .4) 52%,  rgba(255, 255, 255, .4) 77%, transparent 77%,  transparent ); background-image: -o-linear-gradient(  135deg,  rgba(255, 255, 255, .4) 27%, transparent 27%,  transparent 52%, rgba(255, 255, 255, .4) 52%,  rgba(255, 255, 255, .4) 77%, transparent 77%,  transparent ); background-image: linear-gradient(  135deg,  rgba(255, 255, 255, .4) 27%, transparent 27%,  transparent 52%, rgba(255, 255, 255, .4) 52%,  rgba(255, 255, 255, .4) 77%, transparent 77%,  transparent );}
.markdown-body .progress-100plus .progress-bar {background-color: #a6d796;}
.markdown-body .progress-80plus .progress-bar {background-color: #c6d796;}
.markdown-body .progress-60plus .progress-bar {background-color: #d7c896;}
.markdown-body .progress-40plus .progress-bar {background-color: #d7a796;}
.markdown-body .progress-20plus .progress-bar {background-color: #d796a6;}
.markdown-body .progress-0plus .progress-bar {background-color: #c25f77;}
.markdown-body .candystripe-animate .progress-bar{-webkit-animation: animate-stripes 3s linear infinite; -moz-animation: animate-stripes 3s linear infinite; animation: animate-stripes 3s linear infinite;}
@-webkit-keyframes animate-stripes {
 0% {background-position: 0 0;}
 100% {background-position: 60px 0;}
}
@-moz-keyframes animate-stripes {
  0% {background-position: 0 0;}
  100% {background-position: 60px 0;}
}
@keyframes animate-stripes {
  0% {background-position: 0 0;}
  100% {background-position: 60px 0;}
}
.markdown-body .gloss .progress-bar {box-shadow:  inset 0 4px 12px rgba(255, 255, 255, .7),  inset 0 -12px 0 rgba(0, 0, 0, .05);}
/* Multimarkdown Critic Blocks */.markdown-body .critic_mark {background: #ff0;}
.markdown-body .critic_delete {color: #c82829; text-decoration: line-through;}
.markdown-body .critic_insert {color: #718c00 ; text-decoration: underline;}
.markdown-body .critic_comment {color: #8e908c; font-style: italic;}
.markdown-body .headeranchor {font: normal normal 16px octicons-anchor; line-height: 1; display: inline-block; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;}
.headeranchor:before {content: '\f05c';}
.markdown-body .task-list-item {list-style-type: none;}
.markdown-body .task-list-item+.task-list-item {margin-top: 3px;}
.markdown-body .task-list-item input {margin: 0 4px 0.25em -20px; vertical-align: middle;}
/* Media */@media only screen and (min-width: 480px) {.markdown-body {font-size:14px;}}
@media only screen and (min-width: 768px) {.markdown-body {font-size:16px;}}
@media print {
 .markdown-body * {background: transparent !important;  color: black !important;  filter:none !important;  -ms-filter: none !important;}
 .markdown-body {font-size:12pt;  max-width:100%;  outline:none;  border: 0;}
 .markdown-body a, .markdown-body a:visited {text-decoration: underline;}
 .markdown-body .headeranchor-link {display: none;}
 .markdown-body a[href]:after {content: " (" attr(href) ")";}
 .markdown-body abbr[title]:after {content: " (" attr(title) ")";}
 .markdown-body .ir a:after, .markdown-body a[href^="javascript:"]:after, .markdown-body a[href^="#"]:after {content: "";}
 .markdown-body pre {white-space: pre;  white-space: pre-wrap;  word-wrap: break-word;}
 .markdown-body pre, .markdown-body blockquote {border: 1px solid #999;  padding-right: 1em;  page-break-inside: avoid;}
 .markdown-body .progress, .markdown-body .progress-bar {-moz-box-shadow: none;  -webkit-box-shadow: none;  box-shadow: none;}
 .markdown-body .progress {border: 1px solid #ddd;}
 .markdown-body .progress-bar {height: 22px;  border-right: 1px solid #ddd;}
 .markdown-body tr, .markdown-body img {page-break-inside: avoid;}
 .markdown-body img {max-width: 100% !important;}
 .markdown-body p, .markdown-body h2, .markdown-body h3 {orphans: 3;  widows: 3;}
 .markdown-body h2, .markdown-body h3 {page-break-after: avoid;}
}
<?php }elseif ($_GET['key'] == 'mdjs') { header("Content-Type:application/javascript"); ?>
String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var r=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>r.length)&&(t=r.length),t-=e.length;var n=r.lastIndexOf(e,t);return n!==-1&&n===t}),function(){function e(e){var e=e.replace(/&/g,"&gt;");return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/ /g,"&nbsp;").replace(/\'/g,"&#39;").replace(/\"/g,"&quot;").replace(/\n/g,"</br>")}function t(e){var t={},r=[];this.set=function(n,i,o){o&&(i.id=r.push(i)),i.url=e.func.footNoteName(i.id),t[n.toLowerCase()]=i},this.get=function(e){return t[e.toLowerCase()]},this.getFootNoteList=function(){return r}}function r(){var e=[],t=[],r=0;this.topLevel=function(){return r?e[r-1]:-1},this.topType=function(){return r?t[r-1]:-1},this.push=function(n,i){e.push(n),t.push(i),r++},this.pop=function(){e.pop(),t.pop(),r=e.length}}function n(){this.tag={hr:"<hr />",br:"<br />",p:["<p>","</p>"],quote:["<blockquote>","</blockquote>"],del:["<del>","</del>"],strong:["<strong>","</strong>"],em:["<em>","</em>"],inlineCode:["<code>","</code>"],codeBlock:['<pre><code data-lang="$language">',"</code></pre>"],list:["<ul>","</ul>"],orderList:["<ol>","</ol>"],listItem:["<li>","</li>"],toc:['<div class="md_toc">',"</div>"],tocList:["<ol>","</ol>"],tocItem:['<a href="#$uri"><li>',"</li></a>"],footNote:['<div class="md_foot"><ol>',"</ol></div>"]},this.func={heading:function(e,t,r){return"<h"+e+' id="'+t+'" name="'+t+'">'+r+"</h"+e+">"},link:function(t,r,n){return'<a title="'+e(r)+'" href="'+encodeURI(t)+'">'+n+"</a>"},email:function(e){return'<a href="mailto:'+e+'">'+e+"</a>"},image:function(t,r,n){return'<img alt="'+e(n)+'" title="'+e(r)+'" src="'+encodeURI(t)+'" />'},table:function(e,t){return'<table class="md_table"><thead>'+e+"</thead><tbody>"+t+"</tbody></table>"},tableRow:function(e,t,r){for(var n="<tr>",i=e?'<th style="text-align: {0}">':'<td style="text-align: {0}">',o=e?"</th>":"</td>",l=["left","center","right"],a=0;a<t.length;a++)n+=i.replace("{0}",l[r[a]])+t[a]+o;return n+"</tr>"},footNoteLink:function(t,r,n){return'<sup><a title="'+e(r)+'" href="#'+encodeURI(t)+'">'+n+"</a></sup>"},footNote:function(e,t){return'<li name="'+e+'" id="'+e+'">'+t+"</li>"},footNoteName:function(e){return"markdown_foot_"+e}};var t=[];this.addRefLinkProvider=function(e){return t.push(e)},this._resolveRefLink=function(e){for(var r,n=0;n<t.length;n++)if(r=t[n](e))return r.url?r:{url:r}}}function i(i){function v(e){e=e.trim();var t={url:e,title:""},r=e.match(/(.+?)\s+(.+)/);if(!r)return t;t.url=r[1];var n=r[2],i=n[0],o=n[n-1];return n.length>=2&&(("'"==i||'"'==i)&&i==o||"("==i&&")"==o)&&(n=n.slice(1,-1)),t.title=n,t}function b(e){var t=e[0];if("="!=t&&"-"!=t&&"_"!=t&&"*"!=t)return!1;for(var r=0,n=0;r<e.length;r++)if(" "!=e[r]&&"\t"!=e[r]){if(e[r]!=t)return!1;n++}return n>=3}function k(e){for(var t=0,r=0;r<e.length;r++)if(" "==e[r])t++;else{if("\t"!=e[r])break;t+=4}return t}function w(e){for(var t=0;t<e.length&&"#"==e[t];t++);return!!t&&t}function L(e){return e.endsWith("  ")}function y(e){return e.replace(c,"_").replace(/^_/,"").replace(/_$/,"")}function N(t,r,n){for(var i="",o=t.length,l=0,a="",c="",u=0,s=[],h=[],g=-1,p=[],m=[],v=[],j=0,W=!0,M=!1,B="",T={},A=0,E=0;E<o;E++)if(a=t[E],c=a.trim(),l){if("```"==c){l=0,i+=q.codeBlock[1];continue}i+=(l++>1?"\n":"")+e(a)}else{u=k(a);var U=_(c);if(0==U)if(i+=x(),0!=c.length){if(u<4){if(c.startsWith("```")){var H=c.slice(3).trim();i+=q.codeBlock[0].replace(d,H),l=1;continue}if(0!=(A=w(c))){for(var P=c.length-1;P>A&&"#"==c[P];P--);var z=c.slice(A,P+1),D=z=$(z,0);v[j]=A,p[j]=D=D.trim().replace(f,""),m[j++]=D=y(D),i+=C.heading(A,D,z);continue}if(">"==c[0]&&c.length>1){for(var G=[],J=E;J<o&&(B=t[J].trim(),0!=B.length);J++){if(">"==B[0])B=B.slice(1)+(L(t[J])?"  ":"");else{if(r)break;B=t[J]}G.push(B)}i+=q.quote[0]+N(G,!0,n)+q.quote[1],E=J-1;continue}if(b(c)){i+=q.hr;continue}if("[TOC]"==c){g=i.length;continue}if(0!=(s=F(c))&&E<o-1&&0!=(h=R(t[E+1].trim(),s.length))){for(var K=C.tableRow(!0,s,h),Q="",V=E+2;V<o&&0!=(s=F(t[V].trim()));V++)Q+=C.tableRow(!1,s,h);E=V-1,i+=C.table(K,Q);continue}}else if(0==E||0==t[E-1].trim().length){i+=q.codeBlock[0].replace(d,"");for(var X,Y="",Z=E,V=E;V<o;V++)if(0!=t[V].trim().length){if((X=k(t[V]))<4)break;i+=Y+(V==E?"":"\n")+O(X-2)+e(t[V].trim()),Y="",Z=V}else Y+="\n";i+=q.codeBlock[1],E=Z;continue}if(E+1<o){var ee=t[E+1].trim();if(b(ee)){var te=3;"="==ee[0]?te=1:"-"==ee[0]&&(te=2);var D=z=$(c,0);v[j]=te,p[j]=D=D.trim().replace(f,""),m[j++]=D=y(D),i+=C.heading(te,D,z),E++;continue}}T={},B=$(a,0,T),B.trim(),W&&T.onlyOneImg?i+=B:(W&&(B=q.p[0]+B,M=!1),(n.alwaysNewline&&!W||M)&&(i+=q.br),M=L(a),i+=B,W=!1)}else W||(i+=(M?q.br:"")+q.p[1],W=!0);else i+=I(u,U,c)}return W||(i+=(M?q.br:"")+q.p[1],W=!0),g!=-1&&(i=i.slice(0,g)+S(p,m,v)+i.slice(g)),i}function S(e,t,r){for(var n,i,o=q.toc[0],l=[],a=0;a<e.length;a++)i=q.tocItem[0].replace("$uri",t[a])+e[a]+q.tocItem[1],0==l.length||r[a]>n?(o+=q.tocList[0]+i,l.push(n=r[a])):r[a]==n?o+=i:(o+=q.tocList[1],l.pop(),n=l[l.length-1],a--);for(;l.length;)o+=q.tocList[1],l.pop();return o+q.toc[1]}function _(e){return b(e)?0:e.search(a)!=-1?1:e.search(l)!=-1?2:0}function I(e,t,r){var n=B.topLevel(),i=q.listItem[0]+$(r,r.indexOf(" "))+q.listItem[1],o="";if(e>n)return B.push(e,t),(1==t?q.orderList:q.list)[0]+i;if(e==n)return i;for(;e<n;)o+=1==B.topType()?q.orderList[1]:q.list[1],B.pop(),n=B.topLevel();return n==-1?(B.push(e,t),o+(1==t?q.orderList:q.list)[0]+i):o+i}function x(){for(var e="";B.topLevel()!=-1;)e+=1==B.topType()?q.orderList[1]:q.list[1],B.pop();return e}function R(e,t){var r=F(e,!0),n=[],i=0,o=0;if(0==r)return!1;for(var l=r.length;i<l;i++,o=0)r[i].length<=1?n[i]=0:(":"==r[i][r[i].length-1]&&(o=":"==r[i][0]?1:2),n[i]=o);for(;i<t;i++)n[i]=0;return n}function F(e,t){var r=[],n=e.length,i="";void 0==t&&(t=!1);for(var o="|"==e[0]?1:0;o<n;o++){switch(e[o]){case"\\":if(t)return!1;i+="\\","|"==e[o+1]&&(i+="|",o++);continue;case"|":if(i=i.trim(),t&&0==i.length)return!1;r.push(i),i="";continue}if(t&&":"!=e[o]&&"-"!=e[o]&&" "!=e[o]&&"\t"!=e[o])return!1;i+=e[o]}return(0!=r.length||"|"==e[0])&&(i=i.trim(),0!=i.length&&r.push(i),r)}function O(e){return e<=0?"":m.slice(0,e)}function $(t,r,n){for(var i,l,a,f,c,h,g,p,d,m=t.length,b=[],k="",w=-1,L=-1,y=-1,N=-1,S=-1,_="*",I="*",x=0,R=r||0;R<m;R++)switch(t[R]){case"\\":o.indexOf(t[R+1])>=0&&(w=b.length,L=++R),k+=t[R];break;case"`":h="`"==t[R+1]?"``":"`",g=h.length,(i=t.indexOf(h,R+g))==-1?k+=h:(k+=q.inlineCode[0]+e(t.slice(R+g,i))+q.inlineCode[1],R=i),R+=g-1;break;case"~":"~"==t[R+1]?(S>=0?""==k?b[S]+="~~":(b[S]+=q.del[0],k+=q.del[1],S=-1):(S=b.push(k)-1,k=""),R++):k+="~";break;case"*":case"_":if(!(" "!=t[R+1]&&"\t"!=t[R+1]||" "!=t[R-1]&&"\t"!=t[R-1])){k+=t[R];break}if(t[R+1]==t[R]){if(y>=0){if(_!=t[R]){k+=t[R++]+t[R];break}b[y]+=q.strong[0],k+=q.strong[1],y=-1}else t[R+2]==t[R]&&t[R+3]==t[R]&&(k+=t[R++]+t[R++]),y=b.push(k)-1,k="",_=t[R];R++}else if(N>=0){if(I!=t[R]){k+=t[R];break}b[N]+=q.em[0],k+=q.em[1],N=-1}else N=b.push(k)-1,k="",I=t[R];break;case">":k+=R>=2&&"--"==t.slice(R-2,R)?"-->":">";break;case"<":if("!--"==t.slice(R+1,R+4)){k+="<!--";break}for(d=1,i=R+1;i<m&&">"!=t[i];i++)" "!=t[i]&&"\t"!=t[i]||(d=0);if(i>=m){k+="&lt;";break}if(h=t.slice(R+1,i),d){if(h.match(u)){k+=C.link(h,"",h),R=i;break}if(h.match(s)){k+=C.email(h),R=i;break}}k+="<";break;case"!":"["!=t[R+1]&&(k+="!");break;case"[":l="!"!=t[R-1]||w==b.length&&L==R-1?"^"==t[R+1]?"s":"":"i";for(var F=0,O=R+1,j=0;O<m;O++)switch(t[O]){case"!":if("["!=t[O+1])break;""!=l?O=m:(F=1,O++);break;case"`":h="`"==t[O+1]?"``":"`",g=h.length,(i=t.indexOf(h,O+g))==-1?O+=g-1:O=i+g-1;break;case"[":O=m;break;case"]":if(a=t.slice(R+1,O),"s"==l){p=M.get(a),p&&(k+=C.footNoteLink(p.url,p.title,p.id),j=1,R=O,O=m);break}h=t[O+1];var B;if("("==h)B=")";else{if("["!=h&&(" "!=h||"["!=t[O+2])){O=m;break}B="]"}if(g=" "==h?O+3:O+2,(i=t.indexOf(B,g))!=-1){if(F){F=0;break}var T=t.slice(g,i).trim();if("]"==B){if(0==T.length&&(T=a),!(p=M.get(T))&&!(p=W._resolveRefLink(T))){O=m;break}}else p=v(T);f=p.url,c=p.title||"","i"==l?(b.push(k),b.push(C.image(f,c,a)),k="",x++):k+=C.link(f,c,$(a,0)),j=1,R=i}O=m}if(!j&&O>=m)switch(l){case"s":k+="[^",R++;break;case"i":k+="![";break;default:k+="["}break;default:k+=t[R]}if(b.push(k),S!=-1&&(b[S]+="~~"),y!=-1&&(b[y]+=_+_),N!=-1&&(b[N]+=I),1==x){var A=0;for(var E in b)A+=b[E].trim()?1:0;1==A&&n&&(n.onlyOneImg=!0)}return b.join("")}function j(){var e=M.getFootNoteList();if(0==e.length)return"";var t=q.footNote[0];return e.forEach(function(e){return t+=C.footNote(e.url,$(e.content,0))}),t+q.footNote[1]}var W=new n;i&&(W=i);var q=W.tag,C=W.func,M=new t(W),B=new r;this.render=W,this.md2html=function(e,n){n=n||{},e="string"==typeof e?e:String(e),M=new t(W),B=new r;for(var i=e.replace(h,"\n").split(g),o=i.length,l=[],a="",f=0;f<o;f++){a=i[f];var c=a.trim().match(p);if(c){var u,s=!1,d="";if(s="^"==c[1]){d=c[3];for(var m=f+1;m<o&&(a=i[m].trim())&&!a.match(p);m++,f++)d+="\n"+i[m];u={title:c[2],content:d}}else u=v(c[3].trim());M.set(c[1]+c[2],u,s)}else l.push(a)}return N(l,!1,n)+j()}}var o="#`*[]()-_{}+.!|\\",l=/^[\*\-\+] +\S*/g,a=/^\d+\. +\S*/g,f=/<\/?[^<>]+>/g,c=/\W+/g,u=/^\w+:\/{2,3}\S+$/g,s=/^\S+@\S+\.\S+$/g,h=/\r\n/g,g=/[\r\n]/,p=/^\[([\^]?)(.+)\]\:\s+(.+)$/,d=/\$language/g,m=new Array(1024).join(" "),v=new i;i.md2html=function(e,t){return v.md2html(e,t)},i.escapedHTML=e,i.MdjsRenderer=n,i.Mdjs=i,"object"==typeof module&&"object"==typeof global&&(module.exports=global.Mdjs=i),"undefined"!=typeof window&&(window.Mdjs=i)}();
//# sourceMappingURL=mdjs.min.js.map
<?php } ?>